<?php

namespace app\beautiful\model\logs;

use app\beautiful\model\member\MemberModel;

use app\common\model\CommonModel;



class MemberBalanceLogsModel extends CommonModel{

    protected  $name = 'beautiful_member_balance_logs';

    protected  $pk   = 'member_balance_logs_id';



    public function member()

    {

        return $this->hasOne(MemberModel::class,'member_id','member_id');

    }



    public function getOperateHiddenMobileAttr($value,$data)

    {

        return $data['operate_mobile'] ? yc_phone($data['operate_mobile']) : '';

    }

    public function statistics($where,$field){
        $sum = $this->where($where)->sum($field);
        return $sum;

    }

}

